package com.framework.controller;

import com.framework.entity.or.OrAppMenu;
import com.framework.exception.util.RespResult;
import com.framework.service.AppMenuService;
import com.framework.service.BannerService;
import com.framework.service.OrAppAdvService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 功能描述:
 *
 * @author ck
 * @date 2018/9/6 10:23
 */
@RestController
@Api(value="其它模块",tags={"其它模块"})
public class OtherController {

	@Autowired
	private BannerService bannerService;


	@Autowired
	private AppMenuService appMenuService;
	/**
	 *  获取首页的基础信息
	 * @param deptId 渠道id
	 */
	@GetMapping("getIndexOther")
	@ApiOperation("根据所属渠道查询首页信息")
	public RespResult getIndexOther(Long deptId) {
		Map<String,Object> map = bannerService.queryBannerAndMen(deptId);
		return RespResult.ok(map);
	}

	/**
	 *  获取首页的基础信息
	 * @param deptId 渠道id
	 */
	@GetMapping("getIndexMenuList")
	@ApiOperation("根据所属渠道查询首页信息")
	public RespResult getIndexMenuList(Integer type,Long deptId) {
		List<OrAppMenu> list = appMenuService.queryAppMenuList(type, deptId);
		return RespResult.ok().put("list",list);
	}

}
